<template>
  <el-container>
    <el-aside width="200px" >


      <el-menu default-active="1-4-1"
               class="el-menu-vertical-demo"
               @select="openMenu"
               @open="handleOpen"
               @close="handleClose"
               >
        <el-menu-item index="1" route="type">
          <i class="el-icon-menu"></i>
          <!--          <span slot="title">导航二</span>-->
          <span slot="title">石材种类</span>
          <!--          <el-link :underline="false" href="#/home/inventory/type">石材类型</el-link>-->
        </el-menu-item>
        <el-menu-item index="2" route="type">
          <i class="el-icon-menu"></i>
<!--          <span slot="title">导航二</span>-->
          <span slot="title">石材记录</span>
<!--          <el-link :underline="false" href="#/home/inventory/type">石材类型</el-link>-->
        </el-menu-item>
        <el-menu-item index="3" >
          <i class="el-icon-document"></i>
          <span slot="title">测试上传</span>
        </el-menu-item>
        <el-menu-item index="4">
          <i class="el-icon-setting"></i>
          <span slot="title">测试highcharts</span>
        </el-menu-item>
      </el-menu>

    </el-aside>
    <el-main>
      <router-view></router-view>
    </el-main>
  </el-container>
</template>

<script>
    export default {
        name: "InventoryMenu",
      data() {
        return {
          isCollapse: true
        }
      },
      methods: {
        handleOpen(key, keyPath) {
          // console.log(key, keyPath);
        },
        handleClose(key, keyPath) {
          // console.log(key, keyPath);
        },
        openMenu(key,keyPath){
          if (key==1){
            this.$router.replace('/home/inventory/type');
          }
          if (key==2){
            this.$router.replace('/home/inventory/number');
          }
          if (key==3){
            this.$router.replace('/home/inventory/upload');
          }if (key==4){
            this.$router.replace('/home/inventory/hightchart');
          }

        }
      }
    }
</script>

<style scoped>

</style>
